package com.financing.platform.vo;

import com.financing.platform.common.CsvExportable;
import com.financing.platform.util.DateUtil;
import com.financing.platform.util.StringUtil;



public class FaUserVO extends BaseVO implements CsvExportable {



	/**
	 * 
	 */
	private static final long serialVersionUID = 3234928396957643760L;
	/**
	 * 用户id
	 */
	private String id;
	/**
	 * 用户名称
	 */
	private String uName;
	/**
	 * 真实姓名
	 */
	private String uRealName;
	/**
	 * 登录名
	 */
	private String uLoginName;
	
	/**
	 * 认证数
	 */
	private Integer authPassCount;
	
	/**
	 * 用户类型 0：自由FA 1：机构账户  3：机构FA
	 */
	private String uType;
	/**
	 * 微信标识 （0 关联 1 未关联）
	 */
	private String wechatFlag;
	
	/**
	 * 公司名称
	 */
	private String uCompanyName;
	
	/**
	 * 公司地址
	 */
	private String uCompanyADD;
	
	/**
	 * 职位
	 */
	private String uJob;

	public String getuName() {
		return uName;
	}

	public void setuName(String uName) {
		this.uName = uName;
	}

	public String getuRealName() {
		return uRealName;
	}

	public void setuRealName(String uRealName) {
		this.uRealName = uRealName;
	}

	public String getuLoginName() {
		return uLoginName;
	}

	public void setuLoginName(String uLoginName) {
		this.uLoginName = uLoginName;
	}

	public Integer getAuthPassCount() {
		return authPassCount;
	}

	public void setAuthPassCount(Integer authPassCount) {
		this.authPassCount = authPassCount;
	}

	public String getWechatFlag() {
		return wechatFlag;
	}

	public void setWechatFlag(String wechatFlag) {
		this.wechatFlag = wechatFlag;
	}

	public String getuCompanyName() {
		return uCompanyName;
	}

	public void setuCompanyName(String uCompanyName) {
		this.uCompanyName = uCompanyName;
	}

	public String getuCompanyADD() {
		return uCompanyADD;
	}

	public void setuCompanyADD(String uCompanyADD) {
		this.uCompanyADD = uCompanyADD;
	}

	public String getuJob() {
		return uJob;
	}

	public void setuJob(String uJob) {
		this.uJob = uJob;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String csvTitle() {
		return "登录名,昵称,地址,公司,职位,关联微信,注册时间,邀请通过人数 ";
	}

	@Override
	public String toCsvString() {
		StringBuilder builder = new StringBuilder();
		builder.append(getuLoginName()).append(",")
		.append(checkString(getuName())).append(",")
		.append(checkString(getuCompanyADD())).append(",")
		.append(checkString(getuCompanyName())).append(",")
		.append(checkString(getuJob())).append(",")
		.append(getWechatFlagForString(getWechatFlag())).append(",")
		.append(DateUtil.getString(getCreateDate(), DateUtil.DEFAULT_DATE_FORMAT)).append(",")
		.append(getAuthPassCount()).append(",");
		return builder.toString();
	}
	/**
	 * 关联微信
	 * @param status
	 * @return
	 */
	public  String getWechatFlagForString(String status){
		if("1".equals(status)){
			return "是";
		}
		return "否";
	}

	/**
	 * checkString
	 * @param status
	 * @return
	 */
	public  String checkString(String status){
		if(StringUtil.isNullOrEmptyStr(status)){
			return "";
		}else{
			return status.replaceAll(",", "，");
		}	
	}

	public String getuType() {
		return uType;
	}

	public void setuType(String uType) {
		this.uType = uType;
	}
}
